ExecuteQuery<TResult>(String,Object[]) Method
Executes SQL queries directly on the database and returns objects.
Parameters
- query
- The SQL query to be executed.
- parameters
- The array of parameters to be passed to the command. Note the following behavior:
- If the number of objects in the array is less than the highest number identified in the command string, an exception is thrown.
- If the array contains objects that are not referenced in the command string, no exception is thrown.
- If any one of the parameters is null, it is converted to DBNull.Value.
Type Parameters
- TResult
Return Value
IEnumerable(T), representing a list of objects returned by the query.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2